﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using ChinaGS.Lian.ModuleRemoting;

public partial class recharge_area_confirm_unicom : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        SysCommon.checkUserLogin();
        if (!IsPostBack)
        {
            String cusNo = this.Request["unicom_num"];            
            UnicomPackage ucp = RemotingClass.uniComBillCheck(cusNo);

            /*UnicomPackage ucp = new UnicomPackage();           
            ucp.Status = true;
            ucp.SerialNo = "123456789";
            ucp.Message = "success";
            ucp.StatusNo = "00";
            ucp.ITEMNO = "1234567";
            ucp.CUSNAME = "denveryee";
            ucp.CUSNO = cusNo;
            ucp.CUSSUM = 0;
            ucp.CHARGE = 0;
            ucp.PREFLAG = "1";
            ucp.PREFLAG_CN = "预付费";
            ucp.PAYNUM = 0;
            ucp.serverSerialNo = "1234567890";*/
            
             if (ucp.Status)
            {
                if (!ucp.StatusNo.Equals("00"))
                {
                    //测试使用
                    this.LabMessage.Text = ucp.Message;
                    //调整内容正式时使用
                    //this.LabMessage.Text = RemotingClass.showErrorMessage(ucp.StatusNo);                        
                    PanBill.Visible = false;
                }
                else
                {                        
                    if(ucp.CHARGE == 0 && ucp.PAYNUM == 50){
                        this.LabMessage.Text = "尊敬的" + ucp.CUSNAME + "，您的号码不支持网络付费，请到就近网点缴费，谢谢！";   
                        PanBill.Visible = false;
                    }else{
                        LabMessage.Text = "尊敬的" + ucp.CUSNAME + "，您的账单信息如下，请确认：";   
                                 LabCusName.Text = ucp.CUSNAME;
                                 LabCusNo.Text = ucp.CUSNO;
                                 LabPreflag_CN.Text = ucp.PREFLAG_CN;
                                 if (!ucp.PREFLAG.Equals("1"))//后付费
                                    {                           
                                        //显示查询结果                                             
                                        this.LabChargeName.Text = "本期账单";
                                        this.LabCharge.Text = ucp.PAYNUM.ToString();                            
                                    }                     
                                    else { //预付费~1
                                        
                                        //显示查询结果            
                                        this.LabChargeName.Text = "账户余额";
                                        this.LabCharge.Text = ucp.CHARGE.ToString();
                                    }                   

                                HidPAYNUM.Value = ucp.PAYNUM.ToString();
                                HidItemNo.Value = ucp.ITEMNO;
                                HidcusNo.Value = ucp.CUSNO;
                                HidCHARGE.Value = ucp.CHARGE.ToString();
                                HidPREFLAG.Value = ucp.PREFLAG;

                                PanBill.Visible = true;
                                
                    }            
                }
            }
            else
            {
                this.LabMessage.Text = "本次操作失败，错误信息是：" + ucp.Message + "请稍后重试！";
                //显示查询失败
                PanBill.Visible = false;
            }

        }        
        }
            protected void  Button1_Click(object sender, EventArgs e)
        {
                Response.Redirect("fill_unicom.aspx?HidPREFLAG=" + HidPREFLAG.Value
                                    + "&HidPAYNUM=" + HidPAYNUM.Value.ToString()
                                    + "&HidCHARGE=" + HidCHARGE.Value.ToString()
                                    + "&HidItemNo=" + HidItemNo.Value
                                    + "&HidcusNo=" + HidcusNo.Value);
        }
}
